#{extends 'CRUD/layout.html' /}
#{set title:messages.get('roles.edit.title') /}

<div id="crudShow" class="${type.name}">

    <h2 id="crudShowTitle">&{'roles.edit.title'}</h2>

    <div class="objectForm">
    #{form action:@save(object._key()), enctype:'multipart/form-data'}
	     #{crud.form fields:['roleName', 'users']}
	    	#{crud.custom 'roleName'}
	    	   <label>&{'roleName'}</label>
	    	   ${object.roleName}
	    	#{/crud.custom}
	    	#{crud.custom 'users'}
	    	   <label>&{'users'}</label>
	    	   ${object.users ?: messages.get('roles.emptyUsersList')}
	    	#{/crud.custom}
	    #{/crud.form}
        <p class="crudButtons">
            <input type="submit" name="_save" value="&{'crud.save', type.modelName}" />
            <input type="submit" name="_saveAndContinue" value="&{'crud.saveAndContinue', type.modelName}" />
        </p>
    #{/form}
    </div>

    #{form @delete(object._key())}
        <p class="crudDelete">
            <input type="submit" value="&{'roles.delete'}" onclick="return confirm('&{'roles.delete'}')"/>
        </p>
    #{/form}

</div>